package com.dt.platform.domain.oa;

import com.github.foxnic.dao.entity.Entity;
import io.swagger.annotations.ApiModel;
import javax.persistence.Table;
import com.github.foxnic.sql.meta.DBTable;
import com.dt.platform.constants.db.OaTables.OA_PROJECT_USER;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import javax.persistence.Transient;
import com.github.foxnic.api.swagger.EnumFor;
import javax.persistence.Id;
import org.github.foxnic.web.domain.hrm.Employee;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.foxnic.commons.lang.DataParser;
import java.util.Map;
import com.github.foxnic.dao.entity.EntityContext;
import com.dt.platform.domain.oa.meta.ProjectUserMeta;
import com.github.foxnic.sql.data.ExprRcd;



/**
 * 项目人员
 * <p>项目人员 , 数据表 oa_project_user 的PO类型</p>
 * @author 金杰 , maillank@qq.com
 * @since 2025-06-27 09:26:43
 * @sign 7CB6C6C9650055D83F535CD247CF82E0
 * 此文件由工具自动生成，请勿修改。若表结构或配置发生变动，请使用工具重新生成。
*/

@Table(name = "oa_project_user")
@ApiModel(description = "项目人员 ; 项目人员 , 数据表 oa_project_user 的PO类型")
public class ProjectUser extends Entity {

	private static final long serialVersionUID = 1L;

	public static final DBTable TABLE =OA_PROJECT_USER.$TABLE;
	
	/**
	 * 创建人ID：创建人ID
	*/
	@ApiModelProperty(required = false,value="创建人ID" , notes = "创建人ID" , example = "110588348101165911")
	private String createBy;
	
	/**
	 * 创建时间：创建时间
	*/
	@ApiModelProperty(required = false,value="创建时间" , notes = "创建时间" , example = "2025-06-24 11:22:49")
	private Date createTime;
	
	/**
	 * 删除人ID：删除人ID
	*/
	@ApiModelProperty(required = false,value="删除人ID" , notes = "删除人ID")
	private String deleteBy;
	
	/**
	 * 删除时间：删除时间
	*/
	@ApiModelProperty(required = false,value="删除时间" , notes = "删除时间")
	private Date deleteTime;
	
	/**
	 * 是否已删除：是否已删除
	*/
	@ApiModelProperty(required = true,value="是否已删除" , notes = "是否已删除" , example = "0")
	private Integer deleted;
	@Transient
	@EnumFor("deleted")
	private Boolean deletedBool;
	
	/**
	 * 主键：主键
	*/
	@Id
	@ApiModelProperty(required = true,value="主键" , notes = "主键" , example = "690581368827973")
	private String id;
	
	/**
	 * 加入时间：加入时间
	*/
	@ApiModelProperty(required = false,value="加入时间" , notes = "加入时间" , example = "2025-06-24 11:22:49")
	private Date inTime;
	
	/**
	 * 离开时间：离开时间
	*/
	@ApiModelProperty(required = false,value="离开时间" , notes = "离开时间")
	private Date outTime;
	
	/**
	 * 归属类型：project,task,phase
	*/
	@ApiModelProperty(required = false,value="归属类型" , notes = "project,task,phase" , example = "project")
	private String ownType;
	
	/**
	 * 项目名称：项目名称
	*/
	@ApiModelProperty(required = false,value="项目名称" , notes = "项目名称" , example = "707142054773260293")
	private String projectId;
	
	/**
	 * 角色：角色
	*/
	@ApiModelProperty(required = false,value="角色" , notes = "角色" , example = "member")
	private String role;
	
	/**
	 * 人员状态：人员状态
	*/
	@ApiModelProperty(required = false,value="人员状态" , notes = "人员状态" , example = "in")
	private String status;
	
	/**
	 * 修改人ID：修改人ID
	*/
	@ApiModelProperty(required = false,value="修改人ID" , notes = "修改人ID")
	private String updateBy;
	
	/**
	 * 修改时间：修改时间
	*/
	@ApiModelProperty(required = false,value="修改时间" , notes = "修改时间")
	private Date updateTime;
	
	/**
	 * 项目人员：项目人员
	*/
	@ApiModelProperty(required = false,value="项目人员" , notes = "项目人员" , example = "E001")
	private String userId;
	
	/**
	 * version：version
	*/
	@ApiModelProperty(required = false,value="version" , notes = "version" , example = "1")
	private Integer version;
	
	/**
	 * user：user
	*/
	@ApiModelProperty(required = false,value="user" , notes = "user")
	private Employee user;
	
	/**
	 * callMethod：callMethod
	*/
	@ApiModelProperty(required = false,value="callMethod" , notes = "callMethod")
	private String callMethod;
	
	/**
	 * taskRcdCount：taskRcdCount
	*/
	@ApiModelProperty(required = false,value="taskRcdCount" , notes = "taskRcdCount")
	private String taskRcdCount;
	
	/**
	 * workTimeTotal：workTimeTotal
	*/
	@ApiModelProperty(required = false,value="workTimeTotal" , notes = "workTimeTotal")
	private String workTimeTotal;
	
	/**
	 * taskCount：taskCount
	*/
	@ApiModelProperty(required = false,value="taskCount" , notes = "taskCount")
	private String taskCount;
	
	/**
	 * workRecord：workRecord
	*/
	@ApiModelProperty(required = false,value="workRecord" , notes = "workRecord")
	private String workRecord;
	
	/**
	 * taskActingCount：taskActingCount
	*/
	@ApiModelProperty(required = false,value="taskActingCount" , notes = "taskActingCount")
	private String taskActingCount;
	
	/**
	 * taskCompleteCount：taskCompleteCount
	*/
	@ApiModelProperty(required = false,value="taskCompleteCount" , notes = "taskCompleteCount")
	private String taskCompleteCount;
	
	/**
	 * taskCompletePct：taskCompletePct
	*/
	@ApiModelProperty(required = false,value="taskCompletePct" , notes = "taskCompletePct")
	private String taskCompletePct;
	
	/**
	 * taskRecord：taskRecord
	*/
	@ApiModelProperty(required = false,value="taskRecord" , notes = "taskRecord")
	private String taskRecord;
	
	/**
	 * 获得 创建人ID<br>
	 * 创建人ID
	 * @return 创建人ID
	*/
	public String getCreateBy() {
		return createBy;
	}
	
	/**
	 * 设置 创建人ID
	 * @param createBy 创建人ID
	 * @return 当前对象
	*/
	public ProjectUser setCreateBy(String createBy) {
		this.createBy=createBy;
		return this;
	}
	
	/**
	 * 获得 创建时间<br>
	 * 创建时间
	 * @return 创建时间
	*/
	public Date getCreateTime() {
		return createTime;
	}
	
	/**
	 * 设置 创建时间
	 * @param createTime 创建时间
	 * @return 当前对象
	*/
	public ProjectUser setCreateTime(Date createTime) {
		this.createTime=createTime;
		return this;
	}
	
	/**
	 * 获得 删除人ID<br>
	 * 删除人ID
	 * @return 删除人ID
	*/
	public String getDeleteBy() {
		return deleteBy;
	}
	
	/**
	 * 设置 删除人ID
	 * @param deleteBy 删除人ID
	 * @return 当前对象
	*/
	public ProjectUser setDeleteBy(String deleteBy) {
		this.deleteBy=deleteBy;
		return this;
	}
	
	/**
	 * 获得 删除时间<br>
	 * 删除时间
	 * @return 删除时间
	*/
	public Date getDeleteTime() {
		return deleteTime;
	}
	
	/**
	 * 设置 删除时间
	 * @param deleteTime 删除时间
	 * @return 当前对象
	*/
	public ProjectUser setDeleteTime(Date deleteTime) {
		this.deleteTime=deleteTime;
		return this;
	}
	
	/**
	 * 获得 是否已删除<br>
	 * 是否已删除
	 * @return 是否已删除
	*/
	public Integer getDeleted() {
		return deleted;
	}
	
	/**
	 * 获得 是否已删除 的投影属性<br>
	 * 等价于 getDeleted 方法，获得对应的枚举类型
	 * @return 是否已删除
	*/
	@Transient
	public Boolean isDeleted() {
		if(this.deletedBool==null) {
			this.deletedBool=DataParser.parseBoolean(deleted);
		}
		return this.deletedBool ;
	}
	
	/**
	 * 设置 是否已删除
	 * @param deleted 是否已删除
	 * @return 当前对象
	*/
	@JsonProperty("deleted")
	public ProjectUser setDeleted(Integer deleted) {
		this.deleted=deleted;
		this.deletedBool=DataParser.parseBoolean(deleted);
		return this;
	}
	
	/**
	 * 设置 是否已删除的投影属性，等同于设置 是否已删除
	 * @param deletedBool 是否已删除
	 * @return 当前对象
	*/
	@Transient
	public ProjectUser setDeleted(Boolean deletedBool) {
		if(deletedBool==null) {
			this.deleted=null;
		} else {
			this.deleted=deletedBool?1:0;
		}
		this.deletedBool=deletedBool;
		return this;
	}
	
	/**
	 * 获得 主键<br>
	 * 主键
	 * @return 主键
	*/
	public String getId() {
		return id;
	}
	
	/**
	 * 设置 主键
	 * @param id 主键
	 * @return 当前对象
	*/
	public ProjectUser setId(String id) {
		this.id=id;
		return this;
	}
	
	/**
	 * 获得 加入时间<br>
	 * 加入时间
	 * @return 加入时间
	*/
	public Date getInTime() {
		return inTime;
	}
	
	/**
	 * 设置 加入时间
	 * @param inTime 加入时间
	 * @return 当前对象
	*/
	public ProjectUser setInTime(Date inTime) {
		this.inTime=inTime;
		return this;
	}
	
	/**
	 * 获得 离开时间<br>
	 * 离开时间
	 * @return 离开时间
	*/
	public Date getOutTime() {
		return outTime;
	}
	
	/**
	 * 设置 离开时间
	 * @param outTime 离开时间
	 * @return 当前对象
	*/
	public ProjectUser setOutTime(Date outTime) {
		this.outTime=outTime;
		return this;
	}
	
	/**
	 * 获得 归属类型<br>
	 * project,task,phase
	 * @return 归属类型
	*/
	public String getOwnType() {
		return ownType;
	}
	
	/**
	 * 设置 归属类型
	 * @param ownType 归属类型
	 * @return 当前对象
	*/
	public ProjectUser setOwnType(String ownType) {
		this.ownType=ownType;
		return this;
	}
	
	/**
	 * 获得 项目名称<br>
	 * 项目名称
	 * @return 项目名称
	*/
	public String getProjectId() {
		return projectId;
	}
	
	/**
	 * 设置 项目名称
	 * @param projectId 项目名称
	 * @return 当前对象
	*/
	public ProjectUser setProjectId(String projectId) {
		this.projectId=projectId;
		return this;
	}
	
	/**
	 * 获得 角色<br>
	 * 角色
	 * @return 角色
	*/
	public String getRole() {
		return role;
	}
	
	/**
	 * 设置 角色
	 * @param role 角色
	 * @return 当前对象
	*/
	public ProjectUser setRole(String role) {
		this.role=role;
		return this;
	}
	
	/**
	 * 获得 人员状态<br>
	 * 人员状态
	 * @return 人员状态
	*/
	public String getStatus() {
		return status;
	}
	
	/**
	 * 设置 人员状态
	 * @param status 人员状态
	 * @return 当前对象
	*/
	public ProjectUser setStatus(String status) {
		this.status=status;
		return this;
	}
	
	/**
	 * 获得 修改人ID<br>
	 * 修改人ID
	 * @return 修改人ID
	*/
	public String getUpdateBy() {
		return updateBy;
	}
	
	/**
	 * 设置 修改人ID
	 * @param updateBy 修改人ID
	 * @return 当前对象
	*/
	public ProjectUser setUpdateBy(String updateBy) {
		this.updateBy=updateBy;
		return this;
	}
	
	/**
	 * 获得 修改时间<br>
	 * 修改时间
	 * @return 修改时间
	*/
	public Date getUpdateTime() {
		return updateTime;
	}
	
	/**
	 * 设置 修改时间
	 * @param updateTime 修改时间
	 * @return 当前对象
	*/
	public ProjectUser setUpdateTime(Date updateTime) {
		this.updateTime=updateTime;
		return this;
	}
	
	/**
	 * 获得 项目人员<br>
	 * 项目人员
	 * @return 项目人员
	*/
	public String getUserId() {
		return userId;
	}
	
	/**
	 * 设置 项目人员
	 * @param userId 项目人员
	 * @return 当前对象
	*/
	public ProjectUser setUserId(String userId) {
		this.userId=userId;
		return this;
	}
	
	/**
	 * 获得 version<br>
	 * version
	 * @return version
	*/
	public Integer getVersion() {
		return version;
	}
	
	/**
	 * 设置 version
	 * @param version version
	 * @return 当前对象
	*/
	public ProjectUser setVersion(Integer version) {
		this.version=version;
		return this;
	}
	
	/**
	 * 获得 user<br>
	 * user
	 * @return user
	*/
	public Employee getUser() {
		return user;
	}
	
	/**
	 * 设置 user
	 * @param user user
	 * @return 当前对象
	*/
	public ProjectUser setUser(Employee user) {
		this.user=user;
		return this;
	}
	
	/**
	 * 获得 callMethod<br>
	 * callMethod
	 * @return callMethod
	*/
	public String getCallMethod() {
		return callMethod;
	}
	
	/**
	 * 设置 callMethod
	 * @param callMethod callMethod
	 * @return 当前对象
	*/
	public ProjectUser setCallMethod(String callMethod) {
		this.callMethod=callMethod;
		return this;
	}
	
	/**
	 * 获得 taskRcdCount<br>
	 * taskRcdCount
	 * @return taskRcdCount
	*/
	public String getTaskRcdCount() {
		return taskRcdCount;
	}
	
	/**
	 * 设置 taskRcdCount
	 * @param taskRcdCount taskRcdCount
	 * @return 当前对象
	*/
	public ProjectUser setTaskRcdCount(String taskRcdCount) {
		this.taskRcdCount=taskRcdCount;
		return this;
	}
	
	/**
	 * 获得 workTimeTotal<br>
	 * workTimeTotal
	 * @return workTimeTotal
	*/
	public String getWorkTimeTotal() {
		return workTimeTotal;
	}
	
	/**
	 * 设置 workTimeTotal
	 * @param workTimeTotal workTimeTotal
	 * @return 当前对象
	*/
	public ProjectUser setWorkTimeTotal(String workTimeTotal) {
		this.workTimeTotal=workTimeTotal;
		return this;
	}
	
	/**
	 * 获得 taskCount<br>
	 * taskCount
	 * @return taskCount
	*/
	public String getTaskCount() {
		return taskCount;
	}
	
	/**
	 * 设置 taskCount
	 * @param taskCount taskCount
	 * @return 当前对象
	*/
	public ProjectUser setTaskCount(String taskCount) {
		this.taskCount=taskCount;
		return this;
	}
	
	/**
	 * 获得 workRecord<br>
	 * workRecord
	 * @return workRecord
	*/
	public String getWorkRecord() {
		return workRecord;
	}
	
	/**
	 * 设置 workRecord
	 * @param workRecord workRecord
	 * @return 当前对象
	*/
	public ProjectUser setWorkRecord(String workRecord) {
		this.workRecord=workRecord;
		return this;
	}
	
	/**
	 * 获得 taskActingCount<br>
	 * taskActingCount
	 * @return taskActingCount
	*/
	public String getTaskActingCount() {
		return taskActingCount;
	}
	
	/**
	 * 设置 taskActingCount
	 * @param taskActingCount taskActingCount
	 * @return 当前对象
	*/
	public ProjectUser setTaskActingCount(String taskActingCount) {
		this.taskActingCount=taskActingCount;
		return this;
	}
	
	/**
	 * 获得 taskCompleteCount<br>
	 * taskCompleteCount
	 * @return taskCompleteCount
	*/
	public String getTaskCompleteCount() {
		return taskCompleteCount;
	}
	
	/**
	 * 设置 taskCompleteCount
	 * @param taskCompleteCount taskCompleteCount
	 * @return 当前对象
	*/
	public ProjectUser setTaskCompleteCount(String taskCompleteCount) {
		this.taskCompleteCount=taskCompleteCount;
		return this;
	}
	
	/**
	 * 获得 taskCompletePct<br>
	 * taskCompletePct
	 * @return taskCompletePct
	*/
	public String getTaskCompletePct() {
		return taskCompletePct;
	}
	
	/**
	 * 设置 taskCompletePct
	 * @param taskCompletePct taskCompletePct
	 * @return 当前对象
	*/
	public ProjectUser setTaskCompletePct(String taskCompletePct) {
		this.taskCompletePct=taskCompletePct;
		return this;
	}
	
	/**
	 * 获得 taskRecord<br>
	 * taskRecord
	 * @return taskRecord
	*/
	public String getTaskRecord() {
		return taskRecord;
	}
	
	/**
	 * 设置 taskRecord
	 * @param taskRecord taskRecord
	 * @return 当前对象
	*/
	public ProjectUser setTaskRecord(String taskRecord) {
		this.taskRecord=taskRecord;
		return this;
	}

	/**
	 * 将自己转换成指定类型的PO
	 * @param poType  PO类型
	 * @return ProjectUser , 转换好的 ProjectUser 对象
	*/
	@Transient
	public <T extends Entity> T toPO(Class<T> poType) {
		return EntityContext.create(poType, this);
	}

	/**
	 * 将自己转换成任意指定类型
	 * @param pojoType  Pojo类型
	 * @return ProjectUser , 转换好的 PoJo 对象
	*/
	@Transient
	public <T> T toPojo(Class<T> pojoType) {
		if(Entity.class.isAssignableFrom(pojoType)) {
			return (T)this.toPO((Class<Entity>)pojoType);
		}
		try {
			T pojo=pojoType.newInstance();
			EntityContext.copyProperties(pojo, this);
			return pojo;
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public ProjectUser clone() {
		return duplicate(true);
	}

	/**
	 * 复制当前对象
	 * @param all 是否复制全部属性，当 false 时，仅复制来自数据表的属性
	*/
	@Transient
	public ProjectUser duplicate(boolean all) {
		com.dt.platform.domain.oa.meta.ProjectUserMeta.$$proxy$$ inst = new com.dt.platform.domain.oa.meta.ProjectUserMeta.$$proxy$$();
		inst.setRole(this.getRole());
		inst.setUpdateTime(this.getUpdateTime());
		inst.setUserId(this.getUserId());
		inst.setVersion(this.getVersion());
		inst.setInTime(this.getInTime());
		inst.setCreateBy(this.getCreateBy());
		inst.setDeleted(this.getDeleted());
		inst.setCreateTime(this.getCreateTime());
		inst.setDeleteTime(this.getDeleteTime());
		inst.setUpdateBy(this.getUpdateBy());
		inst.setDeleteBy(this.getDeleteBy());
		inst.setOwnType(this.getOwnType());
		inst.setId(this.getId());
		inst.setProjectId(this.getProjectId());
		inst.setOutTime(this.getOutTime());
		inst.setStatus(this.getStatus());
		if(all) {
			inst.setCallMethod(this.getCallMethod());
			inst.setTaskRcdCount(this.getTaskRcdCount());
			inst.setTaskCount(this.getTaskCount());
			inst.setTaskCompletePct(this.getTaskCompletePct());
			inst.setTaskRecord(this.getTaskRecord());
			inst.setTaskActingCount(this.getTaskActingCount());
			inst.setWorkRecord(this.getWorkRecord());
			inst.setWorkTimeTotal(this.getWorkTimeTotal());
			inst.setTaskCompleteCount(this.getTaskCompleteCount());
			inst.setUser(this.getUser());
		}
		inst.clearModifies();
		return inst;
	}

	/**
	 * 克隆当前对象
	*/
	@Transient
	public ProjectUser clone(boolean deep) {
		return EntityContext.clone(ProjectUser.class,this,deep);
	}

	/**
	 * 将 Map 转换成 ProjectUser
	 * @param projectUserMap 包含实体信息的 Map 对象
	 * @return ProjectUser , 转换好的的 ProjectUser 对象
	*/
	@Transient
	public static ProjectUser createFrom(Map<String,Object> projectUserMap) {
		if(projectUserMap==null) return null;
		ProjectUser po = create();
		EntityContext.copyProperties(po,projectUserMap);
		po.clearModifies();
		return po;
	}

	/**
	 * 将 Pojo 转换成 ProjectUser
	 * @param pojo 包含实体信息的 Pojo 对象
	 * @return ProjectUser , 转换好的的 ProjectUser 对象
	*/
	@Transient
	public static ProjectUser createFrom(Object pojo) {
		if(pojo==null) return null;
		ProjectUser po = create();
		EntityContext.copyProperties(po,pojo);
		po.clearModifies();
		return po;
	}

	/**
	 * 创建一个 ProjectUser，等同于 new
	 * @return ProjectUser 对象
	*/
	@Transient
	public static ProjectUser create() {
		return new com.dt.platform.domain.oa.meta.ProjectUserMeta.$$proxy$$();
	}

	/**
	 * 从 Map 读取
	 * @param map 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(Map<String, Object> map,boolean cast) {
		if(map==null) return false;
		if(cast) {
			this.setRole(DataParser.parse(String.class, map.get(ProjectUserMeta.ROLE)));
			this.setUpdateTime(DataParser.parse(Date.class, map.get(ProjectUserMeta.UPDATE_TIME)));
			this.setUserId(DataParser.parse(String.class, map.get(ProjectUserMeta.USER_ID)));
			this.setVersion(DataParser.parse(Integer.class, map.get(ProjectUserMeta.VERSION)));
			this.setInTime(DataParser.parse(Date.class, map.get(ProjectUserMeta.IN_TIME)));
			this.setCreateBy(DataParser.parse(String.class, map.get(ProjectUserMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, map.get(ProjectUserMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, map.get(ProjectUserMeta.CREATE_TIME)));
			this.setDeleteTime(DataParser.parse(Date.class, map.get(ProjectUserMeta.DELETE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, map.get(ProjectUserMeta.UPDATE_BY)));
			this.setDeleteBy(DataParser.parse(String.class, map.get(ProjectUserMeta.DELETE_BY)));
			this.setOwnType(DataParser.parse(String.class, map.get(ProjectUserMeta.OWN_TYPE)));
			this.setId(DataParser.parse(String.class, map.get(ProjectUserMeta.ID)));
			this.setProjectId(DataParser.parse(String.class, map.get(ProjectUserMeta.PROJECT_ID)));
			this.setOutTime(DataParser.parse(Date.class, map.get(ProjectUserMeta.OUT_TIME)));
			this.setStatus(DataParser.parse(String.class, map.get(ProjectUserMeta.STATUS)));
			// others
			this.setCallMethod(DataParser.parse(String.class, map.get(ProjectUserMeta.CALL_METHOD)));
			this.setTaskRcdCount(DataParser.parse(String.class, map.get(ProjectUserMeta.TASK_RCD_COUNT)));
			this.setTaskCount(DataParser.parse(String.class, map.get(ProjectUserMeta.TASK_COUNT)));
			this.setTaskCompletePct(DataParser.parse(String.class, map.get(ProjectUserMeta.TASK_COMPLETE_PCT)));
			this.setTaskRecord(DataParser.parse(String.class, map.get(ProjectUserMeta.TASK_RECORD)));
			this.setTaskActingCount(DataParser.parse(String.class, map.get(ProjectUserMeta.TASK_ACTING_COUNT)));
			this.setWorkRecord(DataParser.parse(String.class, map.get(ProjectUserMeta.WORK_RECORD)));
			this.setWorkTimeTotal(DataParser.parse(String.class, map.get(ProjectUserMeta.WORK_TIME_TOTAL)));
			this.setTaskCompleteCount(DataParser.parse(String.class, map.get(ProjectUserMeta.TASK_COMPLETE_COUNT)));
			this.setUser(DataParser.parse(Employee.class, map.get(ProjectUserMeta.USER)));
			return true;
		} else {
			try {
				this.setRole( (String)map.get(ProjectUserMeta.ROLE));
				this.setUpdateTime( (Date)map.get(ProjectUserMeta.UPDATE_TIME));
				this.setUserId( (String)map.get(ProjectUserMeta.USER_ID));
				this.setVersion( (Integer)map.get(ProjectUserMeta.VERSION));
				this.setInTime( (Date)map.get(ProjectUserMeta.IN_TIME));
				this.setCreateBy( (String)map.get(ProjectUserMeta.CREATE_BY));
				this.setDeleted( (Integer)map.get(ProjectUserMeta.DELETED));
				this.setCreateTime( (Date)map.get(ProjectUserMeta.CREATE_TIME));
				this.setDeleteTime( (Date)map.get(ProjectUserMeta.DELETE_TIME));
				this.setUpdateBy( (String)map.get(ProjectUserMeta.UPDATE_BY));
				this.setDeleteBy( (String)map.get(ProjectUserMeta.DELETE_BY));
				this.setOwnType( (String)map.get(ProjectUserMeta.OWN_TYPE));
				this.setId( (String)map.get(ProjectUserMeta.ID));
				this.setProjectId( (String)map.get(ProjectUserMeta.PROJECT_ID));
				this.setOutTime( (Date)map.get(ProjectUserMeta.OUT_TIME));
				this.setStatus( (String)map.get(ProjectUserMeta.STATUS));
				// others
				this.setCallMethod( (String)map.get(ProjectUserMeta.CALL_METHOD));
				this.setTaskRcdCount( (String)map.get(ProjectUserMeta.TASK_RCD_COUNT));
				this.setTaskCount( (String)map.get(ProjectUserMeta.TASK_COUNT));
				this.setTaskCompletePct( (String)map.get(ProjectUserMeta.TASK_COMPLETE_PCT));
				this.setTaskRecord( (String)map.get(ProjectUserMeta.TASK_RECORD));
				this.setTaskActingCount( (String)map.get(ProjectUserMeta.TASK_ACTING_COUNT));
				this.setWorkRecord( (String)map.get(ProjectUserMeta.WORK_RECORD));
				this.setWorkTimeTotal( (String)map.get(ProjectUserMeta.WORK_TIME_TOTAL));
				this.setTaskCompleteCount( (String)map.get(ProjectUserMeta.TASK_COMPLETE_COUNT));
				this.setUser( (Employee)map.get(ProjectUserMeta.USER));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}

	/**
	 * 从 Map 读取
	 * @param r 记录数据
	 * @param cast 是否用 DataParser 进行类型转换
	 * @return  是否读取成功
	*/
	public boolean read(ExprRcd r,boolean cast) {
		if(r==null) return false;
		if(cast) {
			this.setRole(DataParser.parse(String.class, r.getValue(ProjectUserMeta.ROLE)));
			this.setUpdateTime(DataParser.parse(Date.class, r.getValue(ProjectUserMeta.UPDATE_TIME)));
			this.setUserId(DataParser.parse(String.class, r.getValue(ProjectUserMeta.USER_ID)));
			this.setVersion(DataParser.parse(Integer.class, r.getValue(ProjectUserMeta.VERSION)));
			this.setInTime(DataParser.parse(Date.class, r.getValue(ProjectUserMeta.IN_TIME)));
			this.setCreateBy(DataParser.parse(String.class, r.getValue(ProjectUserMeta.CREATE_BY)));
			this.setDeleted(DataParser.parse(Integer.class, r.getValue(ProjectUserMeta.DELETED)));
			this.setCreateTime(DataParser.parse(Date.class, r.getValue(ProjectUserMeta.CREATE_TIME)));
			this.setDeleteTime(DataParser.parse(Date.class, r.getValue(ProjectUserMeta.DELETE_TIME)));
			this.setUpdateBy(DataParser.parse(String.class, r.getValue(ProjectUserMeta.UPDATE_BY)));
			this.setDeleteBy(DataParser.parse(String.class, r.getValue(ProjectUserMeta.DELETE_BY)));
			this.setOwnType(DataParser.parse(String.class, r.getValue(ProjectUserMeta.OWN_TYPE)));
			this.setId(DataParser.parse(String.class, r.getValue(ProjectUserMeta.ID)));
			this.setProjectId(DataParser.parse(String.class, r.getValue(ProjectUserMeta.PROJECT_ID)));
			this.setOutTime(DataParser.parse(Date.class, r.getValue(ProjectUserMeta.OUT_TIME)));
			this.setStatus(DataParser.parse(String.class, r.getValue(ProjectUserMeta.STATUS)));
			return true;
		} else {
			try {
				this.setRole( (String)r.getValue(ProjectUserMeta.ROLE));
				this.setUpdateTime( (Date)r.getValue(ProjectUserMeta.UPDATE_TIME));
				this.setUserId( (String)r.getValue(ProjectUserMeta.USER_ID));
				this.setVersion( (Integer)r.getValue(ProjectUserMeta.VERSION));
				this.setInTime( (Date)r.getValue(ProjectUserMeta.IN_TIME));
				this.setCreateBy( (String)r.getValue(ProjectUserMeta.CREATE_BY));
				this.setDeleted( (Integer)r.getValue(ProjectUserMeta.DELETED));
				this.setCreateTime( (Date)r.getValue(ProjectUserMeta.CREATE_TIME));
				this.setDeleteTime( (Date)r.getValue(ProjectUserMeta.DELETE_TIME));
				this.setUpdateBy( (String)r.getValue(ProjectUserMeta.UPDATE_BY));
				this.setDeleteBy( (String)r.getValue(ProjectUserMeta.DELETE_BY));
				this.setOwnType( (String)r.getValue(ProjectUserMeta.OWN_TYPE));
				this.setId( (String)r.getValue(ProjectUserMeta.ID));
				this.setProjectId( (String)r.getValue(ProjectUserMeta.PROJECT_ID));
				this.setOutTime( (Date)r.getValue(ProjectUserMeta.OUT_TIME));
				this.setStatus( (String)r.getValue(ProjectUserMeta.STATUS));
				return true;
			} catch (Exception e) {
				return false;
			}
		}
	}
}